
package jpoco.io;

import java.util.List;

import jpoco.client.*;
import jpoco.internal.xstream.XStreamFactory;

import com.thoughtworks.xstream.XStream;

/**
 *
 * 
 * @see Deserializer
 * 
 * @author Sean C. Sullivan
 *
 */
public class Serializer
{
	protected XStream xstream;

	public Serializer(Format fmt, Class<? extends Response> clazz)
	{
			xstream = XStreamFactory.createXStream(fmt, clazz);
	}
	
	public String serialize(Response r)
	{
		return xstream.toXML(r);
	}
	
	public String serialize(Contact c)
	{
		return xstream.toXML(c);
	}

	public String serialize(List<Contact> contacts)
	{
		// todo : this method needs work
		
		return xstream.toXML(contacts);
	}
	
}

